package cn.jobstart.dao.impl;

import cn.jobstart.modelExt.ResumeBasicExt;
import cn.jobstart.pubInter.exception.DaoException;
import cn.jobstart.pubInter.exception.DaoExceptionEnum;
import cn.jobstart.pubInter.exception.SkException;
import cn.jobstart.searchExt.ResumeBasicSearchExt;
import cn.jobstart.pubInter.AbstractBaseDao;
import cn.jobstart.dao.mapperExt.ResumeBasicMapperExt;
import cn.jobstart.dao.IResumeBasicDao;
import cn.jobstart.pubInter.IBaseMapper;

import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;

/**
 *    @author sunke
 *    @Date 2023-09-06 15:00:21
 *    @description ResumeBasicDaoImpl      简历基础表
 */
@Repository(value = "resumeBasicDao")
public class ResumeBasicDaoImpl extends AbstractBaseDao<ResumeBasicExt, ResumeBasicSearchExt,String> implements IResumeBasicDao {

    @Resource
    private ResumeBasicMapperExt resumeBasicMapperExt;

    @Override
    public IBaseMapper<ResumeBasicExt,  ResumeBasicSearchExt,String> getMapper() {
        return resumeBasicMapperExt;
    }

    @Override
    public List<String> getIdListBySearch(ResumeBasicSearchExt search) throws SkException {
        try {
            return resumeBasicMapperExt.getIdListBySearch(search);
        }catch (Exception e){
            throw new DaoException(DaoExceptionEnum.DAO_LIST_ERROR);
        }
    }

    @Override
    public ResumeBasicExt getMiniDetailByOldId(String oldId) {
        return resumeBasicMapperExt.getMiniDetailByOldId(oldId);
    }
}